<!--{template header}-->
<!--{template cp_header}-->

<!--{if empty($_GET['op'])}-->
	<form method="post" action="cp.php?ac=space&op=" class="c_form">
		<table cellspacing="0" cellpadding="0" class="formtable">
			<caption>
				<h2>修改密码</h2>
			</caption>
			<tr>
				<th width="100">旧密码</th>
				<td><input type="password" id="password" name="password" value="" class="t_input" /></td>
			</tr>
			<tr>
				<th>新密码</th>
				<td><input type="password" id="newpasswd1" name="newpasswd1" value="" class="t_input"></td>
			</tr>
			<tr>
				<th>确认新密码</th>
				<td><input type="password" id="newpasswd2" name="newpasswd2" value="" class="t_input"></td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td><input type="submit" name="pwdsubmit" value="修改密码" class="submit" /></td>
			</tr>
		</table>
		
		<!--{if $_SCONFIG['allowdomain'] && $_SCONFIG['domainroot'] && $domainlength}-->
		<table cellspacing="0" cellpadding="0" class="formtable">
			<caption>
				<h2>空间域名</h2>
				<p>域名可使用最少 $domainlength 个英数字，最多 30 个英数字，且必须字母开头。</p>
			</caption>
			<tr>
				<th width="100">空间域名</th>
				<td>http://<input type="text" name="domain" value="$space[domain]" size="10" />.{$_SCONFIG[domainroot]}</td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td><input type="submit" name="spacesubmit" value="修改空间名" class="submit" /></td>
			</tr>
		</table>
		<!--{/if}-->
		
		<table cellspacing="0" cellpadding="0" class="formtable">
			<caption>
				<h2>空间属性</h2>
			</caption>
			<tr>
				<th width="100">积分</th>
				<td>$space[credit] &nbsp; [<a href="cp.php?ac=space&op=credit">查看规则</a>] &nbsp; [<a href="cp.php?ac=space&op=exchange">积分兑换</a>]</td>
			</tr>
			<tr>
				<th>用户组</th>
				<td>$space[grouptitle]</td>
			</tr>
			<tr>
				<th>空间容量</th>
				<td> 最大空间 $maxattachsize, 已用 $space[attachsize] ({$percent}%) &nbsp; [<a href="cp.php?ac=space&op=addsize">用积分兑换空间</a>]</td>
			</tr>
		</table>
	</form>

<!--{elseif $_GET['op'] == 'credit'}-->

	<form method="post" action="cp.php?ac=space" class="c_form">
	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>积分</h2>
	</caption>
	<tr><th width="30%">目前您的积分数</th><td>$space[credit] <!--{eval echo getstar($space[credit]);}--></td></tr>
	<tr><th width="30%">星星升级提示</th><td>您还需 <strong><!--{eval echo $_SCONFIG['starcredit']-fmod($space[credit], $_SCONFIG['starcredit']);}--></strong> 个积分可升级一颗星星</td></tr>
	<tr><th>所在的用户组</th><td>$space[grouptitle]</td></tr>
	</table>

	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>积分增加</h2>
		<p>以下操作会使你的积分增加</p>
	</caption>
	<tr><th width="30%">发布日志</th><td>+ $get[blog]</td></tr>
	<tr><th>发布评论/留言</th><td>+ $get[comment]</td></tr>
	<tr><th>发起话题</th><td>+ $get[thread]</td></tr>
	<tr><th>发布回帖</th><td>+ $get[post]</td></tr>
	<tr><th>邀请好友注册成功</th><td>+ $get[invite]</td></tr>
	</table>

	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>积分减少</h2>
		<p>以下操作会扣减你的积分</p>
	</caption>
	<tr><th width="30%">日志被删除</th><td>- $pay[blog]</td></tr>
	<tr><th>评论/留言被删除</th><td>- $pay[comment]</td></tr>
	<tr><th>话题被删除</th><td>- $pay[thread]</td></tr>
	<tr><th>回帖被删除</th><td>- $pay[post]</td></tr>
	<tr><th>获取注册邀请码</th><td>- $pay[invite]</td></tr>
	<tr><th>搜索一次</th><td>- $pay[search]</td></tr>
	<tr><th>增加1M的上传空间</th><td>- $pay[attach]</td></tr>
	<tr><th>日志导入</th><td>- $pay[xmlrpc]</td></tr>
	</table>

	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>用户组与积分对应关系</h2>
		<p>用户组越高，所拥有的权限会越多</p>
	</caption>
	<tr><th width="30%">用户组名</th><td>积分范围</td></tr>
	<!--{loop $groups $value}-->
	<tr><th>$value[grouptitle]</th><td>$value[creditlower] ~ $value[credithigher]</td></tr>
	<!--{/loop}-->
	</table>
	</form>


<!--{elseif $_GET['op'] == 'exchange'}-->

	<form method="post" action="cp.php?ac=space&op=exchange" class="c_form">
	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>积分兑换</h2>
	</caption>
	<tr><th width="30%">目前您的积分数</th><td> $space[credit]</td></tr>
	<tr>
		<th><label for="password">密码</label></th>
		<td><input type="password" name="password" class="t_input" /></td>
	</tr>
	<tr>
		<th>支出积分</th>
		<td><input type="text" id="amount" name="amount" value="0" class="t_input" onkeyup="calcredit();" /></td>
	</tr>
	<tr>
		<th>兑换成</th>
		<td>
			<input type="text" id="desamount" value="0" class="t_input" disabled />&nbsp;&nbsp;
			<select name="tocredits" id="tocredits" onChange="calcredit();">
			<!--{loop $_CACHE['creditsettings'] $id $ecredits}-->
				<!--{if $ecredits[ratio]}-->
					<option value="$id" unit="$ecredits[unit]" title="$ecredits[title]" ratio="$ecredits[ratio]">$ecredits[title]</option>
				<!--{/if}-->
			<!--{/loop}-->
			</select>
		</td>
	</tr>
	<tr>
		<th>兑换比率</th>
		<td><span class="bold">1</span>&nbsp;<span id="orgcreditunit">积分</span><span id="orgcredittitle"></span>&nbsp;兑换&nbsp;<span class="bold" id="descreditamount"></span>&nbsp;<span id="descreditunit"></span><span id="descredittitle"></span></td>
	</tr>
	<tr><th>&nbsp;</th><td><input type="submit" name="exchangesubmit" value="兑换积分" class="submit"></td></tr>
	</table>
	</form>
	<script type="text/javascript">
		function calcredit() {
			tocredit = $('tocredits')[$('tocredits').selectedIndex];
			$('descreditunit').innerHTML = tocredit.getAttribute('unit');
			$('descredittitle').innerHTML = tocredit.getAttribute('title');
			$('descreditamount').innerHTML = Math.round(1/tocredit.getAttribute('ratio') * 100) / 100;
			$('amount').value = $('amount').value.toInt();
			if($('amount').value != 0) {
				$('desamount').value = Math.floor(1/tocredit.getAttribute('ratio') * $('amount').value);
			} else {
				$('desamount').value = $('amount').value;
			}
		}
		String.prototype.toInt = function() {
			var s = parseInt(this);
			return isNaN(s) ? 0 : s;
		}
		calcredit();
	</script>
<!--{elseif $_GET['op'] == 'addsize'}-->
		
	<form method="post" action="cp.php?ac=space&op=addsize" class="c_form">
	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>积分兑换空间容量</h2>
	</caption>
	<tr><th width="30%">附件空间使用</th><td> 已用 $space[attachsize] / $maxattachsize ，使用比例 {$sizewidth}%
		<table cellspacing="0" cellpadding="0" width="100%"><tr><!--{if $sizewidth}--><td width="{$sizewidth}%" bgcolor="red">&nbsp;</td><!--{/if}--><td bgcolor="green">&nbsp;</td></tr></table>
		</td></tr>
	<tr><th>拥有的积分</th><td>$space[credit]</td></tr>
	<tr><th>兑换规则</th><td>兑换1M的上传空间，需要积分数: $pay[attach]</td></tr>
	<tr><th>要兑换的空间大小</th><td><input type="text" name="addsize" value="1" size="5"> M</td></tr>
	<tr><th>&nbsp;</th><td><input type="submit" name="addsizesubmit" value="兑换" class="submit"></td></tr>
	</table>
	</form>

<!--{/if}-->
<div class="f_status s_clear">
	<a href="javascript:;" onclick="window.scrollTo(0,0);" id="a_top" title="TOP">TOP</a>
</div>
<!--{template footer}-->